package com.jctrip.hotel.common.enums;

import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

/**
 * @Author: zxy
 * @CreateTime: 2023-09-08 15:48
 * @Description:
 */
@Getter
public enum NumberEnum {
    ONE("ONE", "1"),
    TWO("TWO", "2"),
    THREE("THREE", "3"),
    FOUR("FOUR", "4"),
    FIVE("FIVE", "5"),
    SIX("SIX", "6"),
    ;

    private final String code;
    private final String msg;

    NumberEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static NumberEnum getByCode(String code) {
        if (StringUtils.isBlank(code)) {
            return null;
        }
        for (NumberEnum item : values()) {
            if (item.getCode().equals(code)) {
                return item;
            }
        }
        return null;
    }
}
